<template>
  <div class="settings-item">
    <div class="header">
      <div class="title">语音输入</div>
      <div class="actions">
      <text-button type="normal" @click="visible=true">{{form.enablevoiceinput ? '开启' : '关闭'}}</text-button>
    </div>
    </div>
  </div>
  <CommonDialog title="语音输入配置"  v-model="visible" :confirmLoading="loading" width="400px">
    <Form :label-width="120" label-position="left">
      <FormItem label="开启语音输入" prop="enablevoiceinput">
        <Switch v-model="form.enablevoiceinput" />
      </FormItem>
      <FormItem label="自动发送" prop="autosend">
        <Switch v-model="form.autosend" />
      </FormItem>
      <FormItem label="自动语音回复" prop="autoreply">
        <Switch v-model="form.autoreply" />
      </FormItem>
    </Form>
    <template #footer>
      <Button @click="visible=false">取消</Button>
      <Button type="primary" @click="submit">确认</Button>
    </template>
  </CommonDialog>
</template>
<script setup>
import { ref } from 'vue';
import { myKnowledge } from '@/api/modules/knowledgeBase';
import CommonDialog from '@/components/CommonDialog/index.vue';
const props = defineProps({
  form: {
    type: Object,
    default: () => {}
  }
})
// 弹窗显示
const visible = ref(false);
const loading = ref(false);

const submit = () =>{
  visible.value = false;
}

</script>